#! /usr/bin/env python
# -*- coding: utf-8 -*-

# *************************************************************
#     Filename @  decopara.py
#       Author @  Huoty
#  Create date @  2015-08-12 11:13:30
#  Description @
# *************************************************************

def deco(arg):
    def _deco(func):
        def __deco():
            print("before %s called [%s]." % (func.__name__, arg))
            func()
            print("  after %s called [%s]." % (func.__name__, arg))
        return __deco
    return _deco

@deco("module")
def foo():
    print(" foo() called.")

@deco("module2")
def hoo():
    print(" hoo() called.")

# Script starts from here

foo()
hoo()
